package com.chenyaowei.product.domain;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.chenyaowei.common.annotation.Excel;
import com.chenyaowei.common.core.domain.BaseEntity;
import org.springframework.data.annotation.Transient;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 商品分类对象 cyw_product_category
 *
 * @author 陈耀威
 * @date 2023-11-20
 */
public class CywProductCategory extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 序号 */
    private Long catId;

    /** 分类名称 */
    @NotNull(message = "分类名称不能为空")
    @Excel(name = "分类名称")
    private String name;

    /** 父分类id */
    @Excel(name = "父分类id")
    private Long parentCid;

    /** 层级 */
    @Excel(name = "层级")
    private Long catLevel;

    /** 是否显示[0-显示，1-不显示] */
    @Excel(name = "是否显示[0-显示，1-不显示]")
    private Integer showStatus;

    /** 排序 */
    @Excel(name = "排序")
    private Long sort;

    @Transient
    private List<CywProductCategory> children;

    public List<CywProductCategory> getChildren() {
        return children;
    }

    public void setChildren(List<CywProductCategory> children) {
        this.children = children;
    }

    public void setCatId(Long catId)
    {
        this.catId = catId;
    }

    public Long getCatId()
    {
        return catId;
    }
    public void setName(String name)
    {
        this.name = name;
    }

    public String getName()
    {
        return name;
    }
    public void setParentCid(Long parentCid)
    {
        this.parentCid = parentCid;
    }

    public Long getParentCid()
    {
        return parentCid;
    }
    public void setCatLevel(Long catLevel)
    {
        this.catLevel = catLevel;
    }

    public Long getCatLevel()
    {
        return catLevel;
    }
    public void setShowStatus(Integer showStatus)
    {
        this.showStatus = showStatus;
    }

    public Integer getShowStatus()
    {
        return showStatus;
    }
    public void setSort(Long sort)
    {
        this.sort = sort;
    }

    public Long getSort()
    {
        return sort;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("catId", getCatId())
            .append("name", getName())
            .append("parentCid", getParentCid())
            .append("catLevel", getCatLevel())
            .append("showStatus", getShowStatus())
            .append("sort", getSort())
            .toString();
    }
}
